<template>
	<!-- 水印 -->
	<view>
		<zmm-watermark :watermark="watermark"></zmm-watermark>
	</view>
	<!-- 用户头像 -->
	<view class="avatar-box" >
			<!-- <uni-card :isFull="true" style="background-image: url(/static/my/index/head-bg.png);"> -->
			<uni-card :isFull="true" style="background-image: url(https://pic3.zhimg.com/80/v2-0cd8b02779909f501a3d02b17cd808ce_1440w.webp);">
				<!-- 头像 -->
				<uni-card style="background-image: url(https://pic2.zhimg.com/80/v2-7adaa0e3a3e53bc7591023b0ccf48965_1440w.webp);">
					<image :src="img_test" class="avatar-img">
					</image>
				</uni-card>
				<!-- 账号 -->
				<uni-card style="background-image: url(https://pic4.zhimg.com/80/v2-0cec34eb87c646b2c57e806a7cf19a13_1440w.webp); text-align: center;">
						<uni-tag text="账号" type="success" :circle="true" :inverted="true" style="display: inline;float: left;"></uni-tag>
						<text style="font-size: 20px;font-weight: bold;">{{username}}</text>
					</uni-card>
			</uni-card>
	</view>
	<view class="container">
		<uni-card padding="20px" spacing="0px">
			<uni-list >
				<uni-list-item title="个人信息" showArrow :thumb="icon_list[0]" :clickable="true" to="/pages/my/info"></uni-list-item>
				<uni-list-item title="历史记录" showArrow :thumb="icon_list[1]" :clickable="true" to="/pages/my/history"></uni-list-item>
				<uni-list-item title="关于" showArrow :thumb="icon_list[2]" :clickable="true" to="/pages/my/about"></uni-list-item>
			</uni-list>
		</uni-card>
	</view>
	<view class="container" style="margin-bottom: 10px;">
		<uni-card  @click="exit">
			<text>退出登录</text>
		</uni-card>
	</view>
</template>

<script>
export default{
	data(){
		return{
			watermark:'default',
			img_test:"/static/my/index/avatar.png",
			icon_list:[
				"/static/number/c1.png",
				"/static/number/c2.png",
				"/static/number/c3.png",
			],
			username:''
		}
	},
	onLoad() {
		let watermark = ''
		let username = ''
		uni.getStorage({
			key: 'uuid',
			success: (res) =>{
				this.watermark = res.data
			}
		});
		uni.getStorage({
			key: 'username',
			success:  (res)=> {
				this.username = res.data
			}
		});
	},
	methods:{
		print(){
			console.log("print")
		},
		change_info(){
			
		},
		exit(){
			uni.clearStorageSync()
			uni.showToast({
				title:"退出成功",
				icon:'none',
				duration:1000
			})
			uni.reLaunch({
				url:"/pages/login/index"
			})
		}
	}
}
	
</script>

<style>
	.avatar-box{
		display: flex;
		/* justify-content: center; */
		align-items: center;
		height: 200px;
	}
	.avatar-box image{
		display: block;
		margin: 0 auto;
		height: 80px;
		width: 80px;
		border-radius: 50%;
	}
	
</style>